home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / ramspy12.zip / RAMSPY.ASM next >
Assembly Source File  |  1991-08-04  |  7KB  |  255 lines

  1. TITLE   RAMSPY
  2. .MODEL  tiny
  3. PAGE    60,80
  4. .CODE
  5.  
  6. RAMSPY: mov     ah,0Fh                  ; Bildschirmmode holen
  7.        int     10h
  8.        cmp     al,2                    ; mono 80x25
  9.        je      do
  10.        cmp     al,3                    ; color 80x25
  11.        je      color
  12.        cmp     al,7                    ; mono
  13.        je      do
  14.  
  15.        mov     dx,Offset error+100h
  16.        mov     ah,9
  17.        int     21h
  18.        int     20h                     ;Ende
  19. ;-----------------------------
  20. color: mov     CS:screen+100h,0B800h   ;set to color display
  21.  
  22. do:    mov     dx,offset copyr+100h    ;show copyright and wait for key
  23.        mov     ah,9
  24.        int     21h
  25.        mov     ah,8
  26.        int     21h
  27.  
  28.        mov     ax,CS:Screen+100h
  29.        mov     ds,ax
  30.        mov     ax,0                    ; Segmentzeiger auf 0000
  31.        mov     es,ax
  32.        mov     cx,0
  33.        mov     bx,0                    ; Zeiger auf 1. Bildschirmzeile
  34.        mov     ax,7020h                ; Weiß auf Schwarz und Leerstelle
  35. schl1: mov     Word Ptr DS:[bx],ax
  36.        inc     bx
  37.        inc     bx
  38.        cmp     bx,0a0h                 ; schon in der 2. Zeile ???
  39.        jl      schl1
  40.        mov     bx,8
  41.        mov     al,':'
  42.        mov     Byte Ptr DS:[bx],al
  43.        mov     ax,0
  44.        mov     bx,6
  45.        call    ausg
  46.        mov     bx,10h
  47.        call    ausg
  48. bild:  mov     dx,0a0h                 ; Zeiger im Bildschirmbereich Zeile 2
  49. schl2: mov     bx,cx
  50.        mov     al,Byte Ptr ES:[bx]
  51.        mov     ah,2                    ; Grün auf Schwarz
  52.        mov     bx,dx
  53.        mov     Word Ptr DS:[bx],ax
  54.        inc     cx
  55.        inc     dx
  56.        inc     dx
  57.        cmp     dx,01f40h               ; VGA (normal = 0fa0)
  58.        jl      schl2
  59.        sub     cx,0f50h                ; Datenzeiger rücksetzen
  60. zeich: mov     ah,6                    ; Funktion Tastatur/Bildschirm
  61.        mov     dl,0ffh                 ; Zeichen von der Tastatur
  62.        int     021h                    ; Funktionsinterrupt von DOS
  63.        je      bild                    ; keine Taste gedrückt
  64.        cmp     al,0
  65.        je      analys
  66.        jmp     schl
  67. analys:mov     ah,6
  68.        mov     dl,0ffh
  69.        int     021h
  70.        cmp     al,48h
  71.        je      cup
  72.        cmp     al,50h
  73.        je      cdn
  74.        cmp     al,4dh
  75.        je      crt
  76.        cmp     al,4bh
  77.        je      clt
  78.        cmp     al,51h
  79.        je      pgdn
  80.        cmp     al,49h
  81.        je      pgup
  82.        jmp     bild
  83. clt:   cmp     cx,0
  84.        je      clt1
  85.        dec     cx
  86.        jmp     aender
  87. clt1:  mov     ax,es
  88.        sub     ax,5
  89.        mov     es,ax
  90.        mov     cx,4fh
  91.        jmp     aender
  92. crt:   cmp     cx,4fh
  93.        je      crt1
  94.        inc     cx
  95.        jmp     aender
  96. crt1:  mov     ax,es
  97.        add     ax,5
  98.        mov     es,ax
  99.        mov     cx,0
  100.        jmp     aender
  101. cup:   mov     ax,es
  102.        sub     ax,5
  103.        mov     es,ax
  104.        jmp     aender
  105. cdn:   mov     ax,es
  106.        add     ax,5
  107.        mov     es,ax
  108.        jmp     aender
  109. pgup:  mov     ax,es
  110.        sub     ax,00f0h
  111.        mov     es,ax
  112.        jmp     aender
  113. pgdn:  mov     ax,es
  114.        add     ax,00f0h
  115.        mov     es,ax
  116. aender:mov     ax,es
  117.        mov     bx,6
  118.        call    ausg
  119.        mov     ax,cx
  120.        mov     bx,10h
  121.        call    ausg
  122.        jmp     bild
  123. ana2:  mov     bx,cx
  124.        mov     ax,Word Ptr ES:[bx]
  125.        mov     bl,ah
  126.        mov     bh,al
  127.        mov     ax,bx
  128.        mov     bx,20h
  129.        call    ausg
  130.        jmp     bild
  131. ana3:  call    eing
  132.        mov     es,ax
  133.        jmp     aender
  134. schl:  cmp     al,0dh
  135.        je      ana2
  136.        cmp     al,69h
  137.        je      ana3
  138.        cmp     al,1bh
  139.        je      rueck
  140.        jmp     bild
  141. rueck: ret                             ; Rücksprung zu DOS
  142.  
  143. ausg:  push    ax                      ; AX = Wert
  144.        push    bx                      ; BX = Bildschirmposition
  145.        push    cx
  146.        push    dx
  147.        push    ds
  148. ainit: mov     cx,CS:Screen+100h
  149.        mov     ds,cx
  150.        mov     cx,4
  151.        mov     dx,ax
  152. aloop: mov     ax,dx
  153.        shr     dx,1
  154.        shr     dx,1
  155.        shr     dx,1
  156.        shr     dx,1
  157.        and     ax,0fh
  158.        cmp     ax,0ah
  159.        jl      adez
  160.        add     ax,37h
  161.        jmp     acont
  162. adez:  add     ax,30h
  163. acont: mov     Byte Ptr DS:[bx],al
  164.        dec     bx
  165.        dec     bx
  166.        dec     cx
  167.        jne     aloop
  168.        pop     ds
  169.        pop     dx
  170.        pop     cx
  171.        pop     bx
  172.        pop     ax
  173.        ret
  174.  
  175. eing:  push    cx                      ; AX = Wert
  176.        push    dx
  177.        push    ds
  178.        mov     ax,40h
  179.        mov     ds,ax
  180.        mov     bx,50h
  181.        mov     ax,0
  182.        mov     Word Ptr DS:[bx],ax     ; Kursor auf Zeile 0 Spalte 0
  183.        mov     ah,2
  184.        mov     dl,0dh
  185.        int     021h
  186.        mov     ax,CS:Screen+100h
  187.        mov     ds,ax
  188.        mov     bx,0
  189.        mov     ax,730h
  190. eloop: mov     Word Ptr DS:[bx],ax
  191.        inc     bx
  192.        inc     bx
  193.        cmp     bx,8
  194.        jl      eloop                   ; Zeile löschen
  195.        mov     bx,0
  196. zeing: mov     ah,6
  197.        mov     dl,0ffh
  198.        int     021h
  199.        je      zeing
  200.        cmp     al,0dh                 ; Return
  201.        je      cr
  202.        cmp     al,30h
  203.        jl      zeing
  204.        cmp     al,39h
  205.        jle     zaus
  206.        cmp     al,61h
  207.        jl      zeing
  208.        cmp     al,66h
  209.        jle     zaus
  210.        jmp     zeing
  211. zaus:  mov     ah,2
  212.        mov     dl,al
  213.        int     021h
  214.        inc     bx
  215.        inc     bx
  216.        cmp     bx,8
  217.        jl      zeing
  218. cr:    mov     bx,0
  219.        mov     cx,0
  220. cloop: mov     ax,Word Ptr DS:[bx]
  221.        and     ax,0ffh
  222.        cmp     ax,39h
  223.        jle     zahl
  224.        sub     ax,57h
  225.        jmp     zcont
  226. zahl:  sub     ax,30h
  227. zcont: add     cx,ax
  228.        inc     bx
  229.        inc     bx
  230.        cmp     bx,6
  231.        jg      zrueck
  232.        shl     cx,1
  233.        shl     cx,1
  234.        shl     cx,1
  235.        shl     cx,1
  236.        jmp     cloop
  237. zrueck:mov     ax,cx
  238.        pop     ds
  239.        pop     dx
  240.        pop     cx
  241.        ret
  242.  
  243. Screen dw 0B000h                         ; Bildschirmspeicher mono (farb = 0b800h)
  244.  
  245. copyr  db 'RAMSPY 1.20  revised by UComp Jan. 1991',0dh,0ah,0ah
  246.        db 'Usage:',0dh,0ah
  247.        db 'Up, Down, PgUp, PgDn       Go through memory by line or page.',0dh,0ah
  248.        db 'Enter                      Display Hex-Value of word in top left corner.',0dh,0ah
  249.        db 'ESC                        End Program.',0dh,0ah,0ah
  250.        db 'Hit any key to start ...$'
  251.  
  252. error  db 7,'RAMSPY can`t start in present video mode !',0dh,0ah,'$'
  253.  
  254.        END  RAMSPY
  255.